package com.sxp.util;

/**
 * Created by lakmini on 10/13/14.
 */

import java.sql.*;

public class DBUtil {

    private static Connection conn=null;

    public static Connection getConnection(){

        try{
            String username = "root";
            String passwd = "7572";

            Class.forName("com.mysql.jdbc.Driver");
            conn=DriverManager.getConnection("jdbc:mysql://localhost/lunch_ordering_system",username,passwd);
        }catch(Exception e){
            e.getMessage();
        }

        return conn;
    }

    public static void closeConnection(Connection conn){
        try{
            conn.close();
        }catch(Exception e){
            e.getMessage();
        }
    }
}